<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<link rel="icon" type="image/svg+xml" href="/favicon.svg?t=20250417" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover" />
		<meta name="google" content="notranslate">
		<title>麦吉 (Magic) - 灯塔引擎新一代企业级 AI 应用创新引擎</title>
		<script src="/config.js"></script>
		<!-- 钉钉登录 -->
		<script src="https://g.alicdn.com/dingding/h5-dingtalk-login/0.21.0/ddlogin.js"></script>
		<!-- 飞书登录 -->
		<script src="https://lf-package-cn.feishucdn.com/obj/feishu-static/lark/passport/qrcode/LarkSSOSDKWebQRCode-1.0.3.js"></script>
		<script>
			// 环境判断和SDK按需加载
			var userAgent = navigator.userAgent || '';
			var isDingtalk = /dingtalk/.test(userAgent?.toLowerCase?.());
			var isLark = /lark/.test(userAgent?.toLowerCase?.());
			var isWeWork = /wxwork/.test(userAgent);

			// 动态加载SDK的通用函数
			function loadScript(src, onSuccess, onError) {
				const script = document.createElement('script');
				script.src = src;
				script.onload = onSuccess || function() {};
				script.onerror = onError || function() {
					console.error('Failed to load script:', src);
				};
				document.head.appendChild(script);
			}

			if (isDingtalk) {
				<!-- 钉钉 js sdk -->
				loadScript('https://g.alicdn.com/dingding/dingtalk-jsapi/3.0.42/dingtalk.open.js',
					function() { console.log('钉钉SDK加载成功'); },
					function() { console.error('钉钉SDK加载失败'); }
				);
			}

			if (isLark) {
				<!-- 飞书 js sdk -->
				loadScript('https://lf-scm-cn.feishucdn.com/lark/op/h5-js-sdk-1.5.35.js',
					function() { console.log('飞书SDK加载成功'); },
					function() { console.error('飞书SDK加载失败'); }
				);
			}
		</script>
		<script>
			var url = new URL(window.location.href)
			var searchParams = url.searchParams
			// 防止重定向页面后，debug状态丢失
			if (searchParams.get("debug") === "true") {
				sessionStorage.setItem("debug", "true")
			}
			if (searchParams.get("debug") === "true" || sessionStorage.getItem("debug")) {
				// 动态加载 vconsole.min.js
				const script = document.createElement('script');
				script.src = '/vconsole.min.js';
				script.onload = function() {
					new VConsole();
				};
				script.onerror = function() {
					console.error("加载VConsole失败");
				};
				document.head.appendChild(script);
			}
		</script>
	</head>

	<body>
		<div id="root"></div>
		<script type="module" src="/src/opensource/main.tsx"></script>
		<script src="https://lf1-cdn-tos.bytegoofy.com/obj/iconpark/icons_12224_357.933fa41cd89163c9985c27baa8f99a43.js"></script>
	</body>
</html>
